#ifndef ApplicationWindow_H
#define ApplicationWindow_H

#include <QMainWindow>
#include "ui_ApplicationWindow.h"
#include <QtSql>
#include "cmysig.h"
#include <qwt_plot_curve.h>
#include "vstatuscolor.h"

class QwtPlotZoomer;
class ApplicationWindow : public QMainWindow
{
    Q_OBJECT

public:
    ApplicationWindow(QWidget *parent = 0);
    ~ApplicationWindow();
    //void showSig(CMySig sig1);
    void dataFinish();
    CMySig sig1;
    //script use
    QString d_python_config_folder;
    QRect d_script_win_rect;
    bool d_script_win_on_top;
    bool d_note_line_numbers;
    QString scriptsDirPath;
    bool isMdiAreaEnabled();
    void enableMdiArea(bool b);
    QColor d_keyword_highlight_color;
    QColor d_class_highlight_color;
    QColor d_numeric_highlight_color;
    QColor d_quotation_highlight_color;
    QColor d_comment_highlight_color;
    QColor d_function_highlight_color;
    //bool event ( QEvent * event );
public slots:
     void chkLsClick(bool b);
  void chkLcClick(bool b);
  void chkHcClick(bool b);
  void chkHsClick(bool b);
    void onDataAllFinish(CMySig *);
    void on_actionClear_All_triggered();
    void on_actionPrint_triggered();
    void on_actionOpenSample_triggered();
    void on_actionDelete_triggered();
    void on_actionAbout_triggered();
    void on_actionStandards_triggered();
    void on_actionExit_triggered();
    void on_actionEditSql_triggered();
    void on_actionImport_triggered();
    void on_actionExport_triggered();
    void on_actionCard_triggered();
    void on_actionBalance_triggered();
    void on_actionUsers_triggered();
    void on_actionCreateMethod_triggered();
    void rowsInserted(QModelIndex, int, int);
    void rowsRemoved(QModelIndex, int, int);
    void currentChanged(QModelIndex c, QModelIndex p);
    void rowsMoved (const QModelIndex & sourceParent, int sourceStart
                    , int sourceEnd
                    , const QModelIndex & destinationParent
                    , int destinationRow);
    void updateHeader(QModelIndex, int, int);
    //    connect(ui.tableView, SIGNAL(selectRow ( int )),
    //            this, SLOT(updateHeader(QModelIndex, int, int)));
    //void on_tableView_currentChanged ( const QModelIndex & current, const QModelIndex & previous );
    void on_mytableview_clicked( const QModelIndex & current);
    void on_mytableview_entered( const QModelIndex & index );
    void on_mytableview_activated( const QModelIndex & index );
    //void on_tableView_rowMoved ( int row, int oldIndex, int newIndex );
    void on_pushButtonWeight_clicked();
    void on_pushButton_start_clicked();
    void on_pushButton_stop_clicked();
    void dataArrive(const QList<double> &l);
    //void on_pushButton_clicked();
   void  scriptsDirPathChanged(const QString&);
private:
    QSqlQueryModel *model;
    QwtPlotCurve *cLeft[16];
    QwtPlotZoomer *d_zoomer;

    Ui::MaMainWindowClass ui;
    VStatusColor *vchannel;
};

#endif // ApplicationWindow_H
